import 'package:taonile/generated/json/base/json_convert_content.dart';
import 'package:taonile/entity/refund_order_detail_entity.dart';

RefundOrderDetailEntity $RefundOrderDetailEntityFromJson(Map<String, dynamic> json) {
	final RefundOrderDetailEntity refundOrderDetailEntity = RefundOrderDetailEntity();
	final int? code = jsonConvert.convert<int>(json['code']);
	if (code != null) {
		refundOrderDetailEntity.code = code;
	}
	final String? msg = jsonConvert.convert<String>(json['msg']);
	if (msg != null) {
		refundOrderDetailEntity.msg = msg;
	}
	final RefundOrderDetailData? data = jsonConvert.convert<RefundOrderDetailData>(json['data']);
	if (data != null) {
		refundOrderDetailEntity.data = data;
	}
	return refundOrderDetailEntity;
}

Map<String, dynamic> $RefundOrderDetailEntityToJson(RefundOrderDetailEntity entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['code'] = entity.code;
	data['msg'] = entity.msg;
	data['data'] = entity.data.toJson();
	return data;
}

RefundOrderDetailData $RefundOrderDetailDataFromJson(Map<String, dynamic> json) {
	final RefundOrderDetailData refundOrderDetailData = RefundOrderDetailData();
	final int? id = jsonConvert.convert<int>(json['id']);
	if (id != null) {
		refundOrderDetailData.id = id;
	}
	final int? type = jsonConvert.convert<int>(json['type']);
	if (type != null) {
		refundOrderDetailData.type = type;
	}
	final int? status = jsonConvert.convert<int>(json['status']);
	if (status != null) {
		refundOrderDetailData.status = status;
	}
	final String? orderNo = jsonConvert.convert<String>(json['order_no']);
	if (orderNo != null) {
		refundOrderDetailData.orderNo = orderNo;
	}
	final int? orderGoodsId = jsonConvert.convert<int>(json['order_goods_id']);
	if (orderGoodsId != null) {
		refundOrderDetailData.orderGoodsId = orderGoodsId;
	}
	final String? refundReason = jsonConvert.convert<String>(json['refund_reason']);
	if (refundReason != null) {
		refundOrderDetailData.refundReason = refundReason;
	}
	final int? num = jsonConvert.convert<int>(json['num']);
	if (num != null) {
		refundOrderDetailData.num = num;
	}
	final String? totalPrice = jsonConvert.convert<String>(json['total_price']);
	if (totalPrice != null) {
		refundOrderDetailData.totalPrice = totalPrice;
	}
	final String? createdAt = jsonConvert.convert<String>(json['created_at']);
	if (createdAt != null) {
		refundOrderDetailData.createdAt = createdAt;
	}
	final String? describe = jsonConvert.convert<String>(json['describe']);
	if (describe != null) {
		refundOrderDetailData.describe = describe;
	}
	final String? image = jsonConvert.convert<String>(json['image']);
	if (image != null) {
		refundOrderDetailData.image = image;
	}
	final List<RefundOrderDetailDataSkuData>? skuData = jsonConvert.convertListNotNull<RefundOrderDetailDataSkuData>(json['sku_data']);
	if (skuData != null) {
		refundOrderDetailData.skuData = skuData;
	}
	final String? title = jsonConvert.convert<String>(json['title']);
	if (title != null) {
		refundOrderDetailData.title = title;
	}
	final String? goodsName = jsonConvert.convert<String>(json['goods_name']);
	if (goodsName != null) {
		refundOrderDetailData.goodsName = goodsName;
	}
	final String? goodsImage = jsonConvert.convert<String>(json['goods_image']);
	if (goodsImage != null) {
		refundOrderDetailData.goodsImage = goodsImage;
	}
	final String? name = jsonConvert.convert<String>(json['name']);
	if (name != null) {
		refundOrderDetailData.name = name;
	}
	final String? phone = jsonConvert.convert<String>(json['phone']);
	if (phone != null) {
		refundOrderDetailData.phone = phone;
	}
	final String? address = jsonConvert.convert<String>(json['address']);
	if (address != null) {
		refundOrderDetailData.address = address;
	}
	final int? detial = jsonConvert.convert<int>(json['detial']);
	if (detial != null) {
		refundOrderDetailData.detial = detial;
	}
	final List<RefundOrderDetailDataOrderDrawbackPlan>? orderDrawbackPlan = jsonConvert.convertListNotNull<RefundOrderDetailDataOrderDrawbackPlan>(json['order_drawback_plan']);
	if (orderDrawbackPlan != null) {
		refundOrderDetailData.orderDrawbackPlan = orderDrawbackPlan;
	}
	return refundOrderDetailData;
}

Map<String, dynamic> $RefundOrderDetailDataToJson(RefundOrderDetailData entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['id'] = entity.id;
	data['type'] = entity.type;
	data['status'] = entity.status;
	data['order_no'] = entity.orderNo;
	data['order_goods_id'] = entity.orderGoodsId;
	data['refund_reason'] = entity.refundReason;
	data['num'] = entity.num;
	data['total_price'] = entity.totalPrice;
	data['created_at'] = entity.createdAt;
	data['describe'] = entity.describe;
	data['image'] = entity.image;
	data['sku_data'] =  entity.skuData.map((v) => v.toJson()).toList();
	data['title'] = entity.title;
	data['goods_name'] = entity.goodsName;
	data['goods_image'] = entity.goodsImage;
	data['name'] = entity.name;
	data['phone'] = entity.phone;
	data['address'] = entity.address;
	data['detial'] = entity.detial;
	data['order_drawback_plan'] =  entity.orderDrawbackPlan.map((v) => v.toJson()).toList();
	return data;
}

RefundOrderDetailDataSkuData $RefundOrderDetailDataSkuDataFromJson(Map<String, dynamic> json) {
	final RefundOrderDetailDataSkuData refundOrderDetailDataSkuData = RefundOrderDetailDataSkuData();
	final String? skuKey = jsonConvert.convert<String>(json['sku_key']);
	if (skuKey != null) {
		refundOrderDetailDataSkuData.skuKey = skuKey;
	}
	final String? skuVal = jsonConvert.convert<String>(json['sku_val']);
	if (skuVal != null) {
		refundOrderDetailDataSkuData.skuVal = skuVal;
	}
	return refundOrderDetailDataSkuData;
}

Map<String, dynamic> $RefundOrderDetailDataSkuDataToJson(RefundOrderDetailDataSkuData entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['sku_key'] = entity.skuKey;
	data['sku_val'] = entity.skuVal;
	return data;
}

RefundOrderDetailDataOrderDrawbackPlan $RefundOrderDetailDataOrderDrawbackPlanFromJson(Map<String, dynamic> json) {
	final RefundOrderDetailDataOrderDrawbackPlan refundOrderDetailDataOrderDrawbackPlan = RefundOrderDetailDataOrderDrawbackPlan();
	final int? id = jsonConvert.convert<int>(json['id']);
	if (id != null) {
		refundOrderDetailDataOrderDrawbackPlan.id = id;
	}
	final int? shopOrderDrawbackId = jsonConvert.convert<int>(json['shop_order_drawback_id']);
	if (shopOrderDrawbackId != null) {
		refundOrderDetailDataOrderDrawbackPlan.shopOrderDrawbackId = shopOrderDrawbackId;
	}
	final String? title = jsonConvert.convert<String>(json['title']);
	if (title != null) {
		refundOrderDetailDataOrderDrawbackPlan.title = title;
	}
	final String? detail = jsonConvert.convert<String>(json['detail']);
	if (detail != null) {
		refundOrderDetailDataOrderDrawbackPlan.detail = detail;
	}
	final String? createdAt = jsonConvert.convert<String>(json['created_at']);
	if (createdAt != null) {
		refundOrderDetailDataOrderDrawbackPlan.createdAt = createdAt;
	}
	final dynamic? updatedAt = jsonConvert.convert<dynamic>(json['updated_at']);
	if (updatedAt != null) {
		refundOrderDetailDataOrderDrawbackPlan.updatedAt = updatedAt;
	}
	return refundOrderDetailDataOrderDrawbackPlan;
}

Map<String, dynamic> $RefundOrderDetailDataOrderDrawbackPlanToJson(RefundOrderDetailDataOrderDrawbackPlan entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['id'] = entity.id;
	data['shop_order_drawback_id'] = entity.shopOrderDrawbackId;
	data['title'] = entity.title;
	data['detail'] = entity.detail;
	data['created_at'] = entity.createdAt;
	data['updated_at'] = entity.updatedAt;
	return data;
}